﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using NeuronESBAccess;
using PassportsModel;
using PassportWinformsClient.Proxy;

namespace PassportWinformsClient
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            SendMessage();            
        }

        private void SendMessage()
        {
            PassportRequest passportRequest = CreateRequest();

            ApplyServiceClient applyServiceClient = new ApplyServiceClient();

            PassportResponse passportResponse = applyServiceClient.MakePassportRequest(passportRequest);
        }

        private PassportRequest CreateRequest()
        {
            PassportRequest identityRequest = PassportRequest.PassportRequestFactory(eGender.Female, eGender.Female);

            identityRequest.PersonDetails.BirthDate = DateTime.ParseExact("1950/12/31", "yyyy/MM/dd", System.Globalization.CultureInfo.CurrentCulture);
           
            identityRequest.PersonDetails.FamilyName = "Wilberforce";
            identityRequest.PersonDetails.GivenNames = "Wilber";

            identityRequest.PassportType = ePassportType.Adult;
            identityRequest.PassportTravellerType = ePassportTravellerType.Ordinary;
            
            return (identityRequest);
            
        }
    }
}
